import QRequest from '@/service/index';
import { generateNameToLevel } from '@/config/constant';
import { ProcessListParams, ProcessListResponse } from './model/type';

/**
 * @: 获取工序排程明细列表
 * @param {ProcessListParams} params
 * @return {*}
 */
export const doGetProcessList = (params: ProcessListParams) => {
    return QRequest.get<ProcessListResponse>(`/process/details/select/page`, {
        params,
        headers: {
            loadingTarget: `#${generateNameToLevel('2')}`
        }
    });
};
/**
 * @: 导出工序排程明细列表
 * @param {ProcessListParams} params
 * @return {*}
 */
export const doExportExcel = (data: ProcessListParams) => {
    return QRequest.post(`/process/details/export/excel`, data, {
        responseType: 'blob',
        headers: {
            hideLoading: 1
        }
    });
};
